//api文件仍保留但不建议使用，推荐使用models中的api。API files remain preserved (deprecated), use models APIs instead.
import type { CmsCategory, CmsCategoryResponse } from './types.js';

import { requestClient } from '#/api/request';

export const getuctooCmsCategoryList = async (page: number, pageSize: number,
  searchParams?: any) => {
  return requestClient.get<CmsCategoryResponse>(`/uctoo/cms_category/${pageSize}/${page}`,{
    params: searchParams,
  });
};

export const getuctooCmsCategory = async (id: string) => {
  return requestClient.get<CmsCategory>(`/uctoo/cms_category/${id}`);
};

export const adductooCmsCategory = async (data: Partial<CmsCategory>) => {
  return requestClient.post<CmsCategory>('/uctoo/cms_category/add', data);
};

export const edituctooCmsCategory = async (data: Partial<CmsCategory>) => {
  return requestClient.post<CmsCategory>('/uctoo/cms_category/edit', data);
};

export const deleteuctooCmsCategory = async (id: string) => {
  return requestClient.post<any>('/uctoo/cms_category/del', { id });
};
